package van.planifolia.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import van.planifolia.interceptor.MyInterceptor;

@Configuration
public class MyMvcConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //注册自己的拦截器,并设置拦截的请求路径
        //拦击所有的请求，但是允许登录的请求访问
		registry.addInterceptor(new MyInterceptor()).addPathPatterns("/**").excludePathPatterns("/Account/login");
    }
}